import java.util.Scanner;
public class Ember {
	int x=0;
	int y=0;
	int fok=0;
	int WHILEDEBUG=0;
	Scanner input = new Scanner(System.in);
	public static void main(String args[]){
		Ember Jenõ = new Ember();
		Jenõ.fordul();
	}

		void fordul(){
			System.out.print("Írd be hány fokkal forduljon el Jenõ: ");
			fok=input.nextInt();
			while(fok>360){ 	// pl ha fok = 3600 az azt fogja jelenteni fok=0
				fok=fok-360;
				WHILEDEBUG++;
				System.out.println("DEBUG WHILE: " + WHILEDEBUG + " = " + fok);
				}

			if(fok<0){
				fok=360+fok;	// ha fok -120 akkor legyen -120 akkor legyen 360-120
				System.out.println("DEBUG: NEGATIVE");
			}
			if(fok<45 || fok>314){
				System.out.println(fok);
				fok=0;
				System.out.println("DEBUG: 1");
			}else if(fok>44 && fok<135){
				System.out.println(fok);
				fok=90;
				System.out.println("DEBUG: 2");
			}else if(fok>134 && fok<225){
				System.out.println(fok);
				fok=180;
				System.out.println("DEBUG: 3");
			}else if(fok>224 && fok<315){
				System.out.println(fok);
				fok=270;
				System.out.println("DEBUG: 4");
			}else{
				System.out.println("IMPOSSIBRUUUUUUU!!!!!!!!!!!");
			}
		}

		void megy(){
			System.out.print("Írd be mennyivel haladjon elõrefele Jenõ: ");
			int elore = input.nextInt();
			if(fok==0){
				y = y+elore;
			}else if(fok==180){
				y = y-elore;
			}else if(fok==90){
				x = x+elore;
			}else if(fok==270){
				x = x-elore;
			}else{
				System.out.println("IMPOSSIBRUUU.");
			}
		}

		void elmegy(int x, int y){
		}
}